<template>
  <div>
    <div>
      <el-table :data="tableData" border style="width: 100%" >
        <el-table-column prop="name" label="序号" width="60">
          <template slot-scope="scope">{{scope.$index+1}}</template>
        </el-table-column>
        
        <el-table-column prop="orderId" label="单号"> </el-table-column>      
        <el-table-column prop="createTime" label="支付时间">
          <template slot-scope="scope">{{timeFun(scope.row.createTime)}}</template>
        </el-table-column>      
        <el-table-column prop="userInfo.userPhone" label="用户手机"> </el-table-column>      
        <el-table-column prop="typeName" label="类别"> </el-table-column>   
        <!-- <el-table-column prop="product.title" label="描述"> </el-table-column>       -->
        <el-table-column prop="amount" label="消费金额"> </el-table-column>      
        <el-table-column prop="amount" label="流向">
          <template slot-scope="scope">
            <div>
              <span v-if="scope.row.amount>0"> 入账</span>
              <span v-if="scope.row.amount<0"> 出账</span>
            </div>
          </template>  
        </el-table-column>      
        <!-- <el-table-column prop="page_view" label="流向"> </el-table-column>       -->
        <el-table-column prop="channel" label="方式">
            <template slot-scope="scope">
              <span v-if="scope.row.channel == 'alipay'">支付宝</span>
              <span v-if="scope.row.channel == 'wxpay'">微信</span>
              <span v-if="scope.row.channel == 'huabei'">花呗</span>
            </template>
        </el-table-column>      
        <el-table-column prop="hospital.name" label="商家"> </el-table-column>      
        <el-table-column prop="status" label="描述">
          <template slot-scope="scope">
            <div>
              <span v-if="scope.row.orderStatus == 1"> 订单支付</span>
              
              <span v-else-if="scope.row.orderStatus == 4">退款</span>
            </div>  
          </template>  
        </el-table-column>      
      </el-table>
    </div>
  </div>
</template>

<script>
  import getTime from '@/Http/getTime'
  
  export default {
   props:['tableData'],
   created(){
   },
   methods:{
     timeFun(val) {
        return getTime(val)
      },   
   }
  }
</script>